package com.sjksy.demo.controller;

import com.sjksy.demo.domain.Branch;
import com.sjksy.demo.service.BranchService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * ClassName: CompanyController
 * Package: com.sjksy.demo.controller
 * Description:
 *
 * @Author 谢依雯
 * @Create 2024/12/19 14:05
 */
@RestController
@RequestMapping("/company")
@Tag(name = "公司相关接口")
public class CompanyController {
    @Resource
    private BranchService branchService;

    @GetMapping("/branches")
    @Operation(description = "查询所有分公司")
    ResponseEntity<List<Branch>> AllBranch(){
        List<Branch> list=branchService.AllBranch();
        return ResponseEntity.ok(list);
    }
}
